package cn.jingyuan.swan.cloud.core;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

@NoArgsConstructor
@ToString(callSuper = true)
public class ExtRestResult<D, E> extends RestResult<D> {

    /** 附加数据 */
    @Getter
    private E extra;

    @Override
    public ExtRestResult<D, E> setCode(String code) {
        super.setCode(code);
        return this;
    }

    @Override
    public ExtRestResult<D, E> setCodeMsg(String codeMsg) {
        super.setCodeMsg(codeMsg);
        return this;
    }

    @Override
    public ExtRestResult<D, E> setData(D data) {
        super.setData(data);
        return this;
    }

    @Override
    public ExtRestResult<D, E> setHttpStatus(Integer httpStatus) {
        super.setHttpStatus(httpStatus);
        return this;
    }

    @Override
    public ExtRestResult<D, E> setMessage(String message) {
        super.setMessage(message);
        return this;
    }

    public ExtRestResult<D, E> setExtra(E extra) {
        this.extra = extra;
        return this;
    }

}
